
/* Used for pages not on another list */
static inline void __add_to_free_list(struct page *page, struct zone *zone,
                                      unsigned int order, int migratetype,
                                      bool tail)
{
    struct free_area *area = &zone->free_area[order];
    int nr_pages = 1 << order;

    if (tail)
        list_add_tail(&page->buddy_list, &area->free_list[migratetype]);
    else
        list_add(&page->buddy_list, &area->free_list[migratetype]);

    area->nr_free++;
}

static inline void __del_page_from_free_list(struct page *page, struct zone *zone,
                                             unsigned int order, int migratetype)
{
    int nr_pages = 1 << order;

    list_del(&page->buddy_list);
    zone->free_area[order].nr_free--;

    __ClearPageBuddy(page);
    set_page_private(page, 0);	
}
